<?php
/**
 * Created by PhpStorm.
 * User: luoshuqi
 * Date: 19-1-4
 * Time: 下午2:55
 */

namespace App\Utils;


trait PasswordTrait
{
    /**
     * 加密密码
     * @param string $plain
     * @return string
     */
    public function password(string $plain): string
    {
        return hash_hmac('sha1', $plain, env('APP_KEY'));
    }
}